/* GUI CONVERTED from rprsiq01.p (converter v1.75) Sat Aug 12 23:11:44 2000 */
/* rprsiq01.p - RESOURCE LOAD SUMMARY INQUIRY                           */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* web convert rprsiq01.p (converter v1.00) Fri Oct 10 13:57:59 1997 */
/* web tag in rprsiq01.p (converter v1.00) Mon Oct 06 14:18:39 1997 */
/*F0PN*/ /*K17H*/ /*                                                    */
/*V8:ConvertMode=Report                                        */
/* REVISION: 1.0     LAST MODIFIED: 06/12/86    BY: pml         */
/* REVISION: 1.0     LAST MODIFIED: 06/16/86    BY: emb         */
/* REVISION: 2.0     LAST MODIFIED: 07/10/87    BY: emb *A76*       */
/* REVISION: 2.0     LAST MODIFIED: 01/06/88    BY: pml *A125*      */
/* REVISION: 4.0     LAST MODIFIED: 12/30/87    BY: wug *A137*      */
/* REVISION: 4.0     LAST MODIFIED: 03/23/88    BY: rl  *A171*      */
/* REVISION: 4.0     LAST MODIFIED: 06/20/89    BY: emb *A748*      */
/* REVISION: 5.0     LAST MODIFIED: 02/20/90    BY: wug *D017*      */
/* REVISION: 5.0     LAST MODIFIED: 04/04/90    BY: ram *B640*      */
/* REVISION: 6.0     LAST MODIFIED: 04/09/90    BY: ram *D018*      */
/* REVISION: 5.0     LAST MODIFIED: 09/27/90    BY: ram *B793*      */
/* REVISION: 6.0     LAST MODIFIED: 02/14/91    BY: ram *D351*      */
/* REVISION: 7.0     LAST MODIFIED: 10/11/91    BY: emb *F024*      */
/* REVISION: 7.3     LAST MODIFIED: 10/23/92    BY: ram *G231*      */
/* REVISION: 8.6     LAST MODIFIED: 11/04/97    BY: bvm *K17H*      */
/* REVISION: 8.6     LAST MODIFIED: 12/13/97    BY: *H0QB*  Russ Witt   */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan   */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00 BY: *N08T* Annasaheb Rahane */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00 BY: *N0KP* myb              */

/*K17H*/ /* DISPLAY TITLE */

/*GUI preprocessor directive settings */
&SCOPED-DEFINE PP_GUI_CONVERT_MODE REPORT

/*K17H*/ {mfdtitle.i "b+ "}

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rprsiq01_p_1 "Per Col"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

     define new shared variable site like si_site.
     define new shared variable start like rq_start.
     define new shared variable ending like rq_end.
     define variable old_start like rq_start.
     define new shared variable rscde like rq_rsc.
     define new shared variable dwm as character format "!(1)"
/*H0QB*     label "D/W/M".   */
/*H0QB*/    label "D/W/M/P".
     define new shared variable idays as integer format ">>>>>9"
/*H0QB*     label "Per Column".    */
/*H0QB*/    label {&rprsiq01_p_1}.
     define new shared variable dev1 like prd_dev.
     define new shared variable path1 like prd_path.

/*K17H* /* DISPLAY TITLE */
 * /*G231*/ {mfdtitle.i "b+ "} **/

     
/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
        site
        rscde
        rs_desc  format "x(9)" no-label no-attr-space
        start
        ending
        dwm
        idays
     with frame a width 80 attr-space THREE-D /*GUI*/.

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



     /* SET EXTERNAL LABELS */
     setFrameLabels(frame a:handle).

     site = global_site.

/*K17H*/ {wbrp01.i}

         repeat:
        do:
           if start = ? then start = today.
           if old_start <> ? then start = old_start.
           if dwm = "" then dwm = "W".
           if idays = 0 or idays = ? then idays = 1.

/*K17H*/       if c-application-mode <> 'web' then
               update site rscde start ending dwm idays with frame a editing:

          if frame-field = "site" then do:
             /* FIND NEXT/PREVIOUS RECORD */
             {mfnp.i si_mstr site si_site site si_site si_site}
             if recno <> ? then do:
            site  = si_site.
            display site with frame a.
             end.
          end.
          else if frame-field = "rscde" then do:
             /* FIND NEXT/PREVIOUS RECORD */
             {mfnp.i rs_mstr rscde rs_rsc rscde rs_rsc rs_rsc}
             if recno <> ? then do:
/*G231*/        site = rs_site.
            rscde = rs_rsc.
/*G231          display rscde rs_desc with frame a. */
/*G231*/        display site rscde rs_desc with frame a.
             end.
          end.
          else do:
             status input.
             readkey.
             apply lastkey.
          end.
           end.

/*K17H*/   {wbrp06.i &command = update &fields = "  site rscde start ending dwm
            idays" &frm = "a"}

/*K17H*/ if (c-application-mode <> 'web') or
/*K17H*/ (c-application-mode = 'web' and
/*K17H*/ (c-web-request begins 'data')) then do:

/*G231         find rs_mstr where rs_rsc = rscde no-lock no-wait no-error. */
/*G231*/       find rs_mstr where rs_rsc = rscde
/*G231*/       and rs_site = site no-lock no-wait no-error.
           if available rs_mstr then display rs_desc with frame a.

           find shop_cal no-lock where shop_site = site
           and shop_wkctr = "" and shop_mch = "" no-error.
           if not available shop_cal then
           find shop_cal no-lock where shop_site = ""
           and shop_wkctr = "" and shop_mch = "" no-error.
           if not available shop_cal then do:
          {mfmsg.i 410 4}
          /* "DEFAULT SHOP CALENDAR DOES NOT EXIST" */
/*K17H*/          if c-application-mode = 'web' then return.
                   pause.
          undo.
           end.

           if start < today and start entered then do:
          {mfmsg.i 15 2}
          /* "START DATE IS BEFORE TODAY" */
           end.

           if index("dwmp",dwm) = 0 then do:
          {mfmsg.i 14 3}
          /* "INTERVAL MUST BE (D)ay (W)eek OR (M)onth" */
/*K17H*/          if c-application-mode = 'web' then return.
                   pause.
          undo.
           end.
/*K17H*/     end.
        end.

        /* SELECT PRINTER */
            {mfselprt.i "terminal" 80}

        old_start = start.
        dev1 = dev.
        path1 = path.

        {gprun.i ""rprsiq1a.p""}

        {mfreset.i}
/*GUI*/ {mfgrptrm.i} /*Report-to-Window*/

     end.

/*K17H*/ {wbrp04.i &frame-spec = a}
